package cn.hd.controller;

import cn.hd.entity.Creatperson;
import cn.hd.entity.Result;
import cn.hd.service.CreatpersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class CreatpersonController {
    @Autowired
    private CreatpersonService creatpersonService;

    @RequestMapping("/addCreatperson")
    public Object addCreatperson(Creatperson creatperson){
        int i = creatpersonService.addCreatperson(creatperson);
        if(i!=0){
            return new Result("200","添加成功",null);
        }else{
            return new Result("400","添加失败",null);
        }
    }

}
